//
//  PKRadioDetailTableViewCell.m
//  PianKe
//
//  Created by ybq on 15/12/23.
//  Copyright © 2015年 B7_Young. All rights reserved.
//

#import "PKRadioDetailTableViewCell.h"

@implementation PKRadioDetailTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _mainImageView = [[UIImageView alloc] initWithFrame:CGRectMake(20, 15, 40, 40)];
        _NewImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)];
        _NewImageView.image = [UIImage imageNamed:@"new"];
        [_mainImageView addSubview:_NewImageView];
        [self.contentView addSubview:_mainImageView];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(75, 15, 250, 20)];
        _titleLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_titleLabel];
        
        _countLabel = [[UILabel alloc] initWithFrame:CGRectMake(75, 45, 50, 10)];
        _countLabel.font = [UIFont systemFontOfSize:8];
        _countLabel.textColor = [UIColor lightGrayColor];
        [self.contentView addSubview:_countLabel];
        
        _playButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _playButton.frame = CGRectMake(kWidth - 40, 25, 20, 20);
        [_playButton setImage:[UIImage imageNamed:@"play"] forState:(UIControlStateNormal)];
        [self.contentView addSubview:_playButton];
    }
    return self;
}

- (void)setModel:(PKRadioDetailModel *)model {
    _model = model;
    _titleLabel.text = model.title;
    _countLabel.text = [NSString stringWithFormat:@"%@",model.musicVisit];
    [_mainImageView sd_setImageWithURL:[NSURL URLWithString:model.coverimg] placeholderImage:[UIImage imageNamed:@"guangpan"]];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
